//引入请求
import {getThreeListRequest , getMockReq , getMockFloorReq} from '@/api/index'



const state = {
    threeList:[],
    bannerList : [],
    floorList : []
};
const mutations = {
    //设置三级列表
    setThreeList(state , value){
        state.threeList = value
    },
    //设置banner数据
    setBannerList(state , value){
        state.bannerList = value
    },
    //设置Floor数据
    setFloorList (state , value){
        state.floorList = value
    }
};

const actions = {
    //请求三级列表
    async getThreeList ({commit}) {
        const re = await getThreeListRequest();
        commit("setThreeList",re)
    },
    //请求banner图片
    async getBannerReq ({commit}){
        const re = await getMockReq();
        commit("setBannerList",re)
    },
    //请求floor数据
    async getFloorList ({commit}){
        const re = await getMockFloorReq();
        commit("setFloorList",re)
    }
};

const getters = {};


export default {
    namespaced : true,
    state,
    mutations,
    actions,
    getters
}